package algorithm;

public class leetcode_0392 {
    public boolean isSubsequence(String s, String t) {
        int len1=s.length();
        int len2=t.length();
        int p=0;
        int q=0;
        if(len1==0) return true;
        if(len2==0) return len1==0;
        while(p<len1&&q<len2){
            if(s.charAt(p)==t.charAt(q)){
                p++;
                q++;
            }
            else{
                q++;
            }
        }
        return p==len1;
    }
}
